<script type="text/javascript">
function submit_host_config() {
  var bValid = true;
  var modal_selector = $("#host_config_modal");
  var host_config_vip = modal_selector.find("#host_config_vip");
  var host_config_network = modal_selector.find("#host_config_network");
  var host_config_netmask = modal_selector.find("#host_config_netmask");
  bValid = bValid && checkRegexp( host_config_vip, /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/, "必须是ip地址");
  bValid = bValid && checkRegexp( host_config_network, /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/, "必须是ip地址");
  bValid = bValid && checkNull(host_config_netmask, "NetMask不能为空");
  bValid = bValid && checkRegexp_num(host_config_netmask, /^[0-9]+$/i, "NetMask大于0的整数");
  bValid = bValid && checkNumRange(host_config_netmask, "请输入正确的NetMask", 0, 32);
  return bValid
}
$(function() {
  var obj = {
    "network": "存储区域网络的网络地址",
    'vip': '提供iscsi客户端访问的虚拟IP地址存储区域网络的网关地址',
    'netmask': "子网掩码(1~31)"
  }
  bindMouseEvent('#host_config_modal', obj);
});
</script>
<div class="modal-header">
  <h3>集群配置</h3>
</div>
<div class="modal-body modal-body-height" id="host_config_modal" style="overflow-y: auto;">
  <div class="pool-create-box">
    <div class="rtn-tip"></div>
    <table class="base-info">
      <tr>
        <td>
          <label>vip</label><a>*</a>
        </td>
        <td colspan="3">
            <input type="text" name="vip" id="host_config_vip" ng-model="first.vip" />
            <i class="fa fa-question-circle" itype="vip"></i>
        </td>
      </tr>
      <tr>
        <td>
            <label>Network</label><a>*</a>
        </td>
        <td>
            <input type="text" name="NetWork" ng-model="first.NetWork" id="host_config_network"  />
            <i class="fa fa-question-circle" itype="network"></i>
        </td>
        <td>
            <label>Netmask</label><a>*</a>
        </td>
        <td>
            <input type="text" name="NetMask" ng-model="first.NetMask" id="host_config_netmask" />
            <i class="fa fa-question-circle" itype="netmask"></i>
        </td>
      </tr>
      <tr>
        <td>
          <label>no hosts</label><a>*</a>
        </td>
        <td class="host_config_">
          <div class="switch">
            <div class="btn_fath clearfix" ng-class="{'on': (first.nohosts === undefined || first.nohosts === true), 'off': first.nohosts === false}" ng-click="toogle($event)">
              <div class="move"></div>
              <div class="btnSwitch btn1">ON</div>
              <div class="btnSwitch btn2 ">OFF</div>
            </div>
          </div>
        </td>
      </tr>
    </table>
  </div>
  <div class="error-tip">
    <p></p><span></span>
  </div>
  <div class="tip">
    <p></p><span></span>
  </div>
</div>
</div>
<!-- modal-body  -->
<div class="modal-footer">
  <button type="button" class="btn btn-blue" ng-click="config()">下一步</button>
  <button type="button" class="btn btn-white" ng-click="cancel()">[[ 'label cancel'|translate ]]</button>
</div>
<!-- modal-footer-->
